﻿namespace HiMap.Style
{
    using HiMap.Base;
    using System;
    using System.Drawing;

    public class PointSymbolFeatureClass : PointSymbolClass, IPointSymbolFeature, IPointSymbol, IHiMapPtr
    {
        public PointSymbolFeatureClass(int Sid)
        {
            base.m_InPtr = VC.KWG_POINTSYMBOLFEATURE_CREATE(Sid);
            base.m_Used = false;
        }

        public PointSymbolFeatureClass(int InPtr, bool Used)
        {
            base.m_InPtr = InPtr;
            base.m_Used = Used;
        }

        public Color FillColor
        {
            get
            {
                int num = VC.KWG_POINTSYMBOLFEATURE_GET_FILLCOLOR(base.m_InPtr);
                int red = num % 0x100;
                int green = (num % 0x10000) / 0x100;
                int blue = num / 0x10000;
                return Color.FromArgb(red, green, blue);
            }
            set
            {
                int color = (value.R + (value.G * 0x100)) + ((value.B * 0x100) * 0x100);
                VC.KWG_POINTSYMBOLFEATURE_SET_FILLCOLOR(base.m_InPtr, color);
            }
        }

        public Color LineColor
        {
            get
            {
                int num = VC.KWG_POINTSYMBOLFEATURE_GET_LINECOLOR(base.m_InPtr);
                int red = num % 0x100;
                int green = (num % 0x10000) / 0x100;
                int blue = num / 0x10000;
                return Color.FromArgb(red, green, blue);
            }
            set
            {
                int color = (value.R + (value.G * 0x100)) + ((value.B * 0x100) * 0x100);
                VC.KWG_POINTSYMBOLFEATURE_SET_LINECOLOR(base.m_InPtr, color);
            }
        }

        public int LineWidth
        {
            get
            {
                return VC.KWG_POINTSYMBOLFEATURE_GET_LINEWIDTH(base.m_InPtr);
            }
            set
            {
                VC.KWG_POINTSYMBOLFEATURE_SET_LINEWIDTH(base.m_InPtr, value);
            }
        }

        public int SID
        {
            get
            {
                return VC.KWG_POINTSYMBOLFEATURE_GET_SID(base.m_InPtr);
            }
        }
    }
}

